package com.bmps.springcloud.insuredmicroservice.model.trail.request;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * @Author :  zlc
 * @Date : 2019/9/10 10:38
 **/
public class TrailRequestDateModel {

    @Valid
    @NotNull(message="请求不能为空!")
    private TrailRequestHeaderModel header;
    
    @NotNull(message="请求不能为空!")
    private TrailRequestModel request;

    public TrailRequestHeaderModel getHeader() {
        return header;
    }

    public void setHeader(TrailRequestHeaderModel header) {
        this.header = header;
    }

    public TrailRequestModel getRequest() {
        return request;
    }

    public void setRequest(TrailRequestModel request) {
        this.request = request;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {return true;}

        if (o == null || getClass() != o.getClass()) {return false;}

        TrailRequestDateModel that = (TrailRequestDateModel) o;

        return new EqualsBuilder()
                .append(header, that.header)
                .append(request, that.request)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(header)
                .append(request)
                .toHashCode();
    }

    @Override
    public String toString() {
        return "TrailRequestDateModel{" +
                "header=" + header +
                ", request=" + request +
                '}';
    }
}
